<?php
namespace app\api\controller;
use app\common\controller\Api;
use think\Db;

class Advice extends Api
{
    protected $noNeedRight = '*';
    protected $noNeedLogin = '*';

    public function _initialize()
    {
        parent::_initialize();
    }
    public function create(){
        $data = $this->request->post();
        $user = $this->auth->getUser();
        $data["user_id"] = isset($user) ? $user->id : 0;
        Db::table("zwa_advice")
            ->insert($data);
        $this->success();
    }
}
